import type { FormField } from '@/components'
import { ref } from 'vue'
import { getTree } from '@/api/systemSetting/personnel'
getTree({ remark: 'zgdw' }).then((res: any) => {
  fields.value.find((item) => item.key === 'supervisoryCode')!.attrs!.data = res.data
})

export const fields = ref([
  {
    key: 'activityName',
    label: '活动名称',
    tag: 'ElInput',
  },
  {
    key: 'orgName',
    label: '组织名称',
    tag: 'ElInput'
  },
  {
    key: 'approvalResult',
    label: '活动状态',
    tag: 'MSelect',
    change:'search',
    attrs: {
      options: [
        {
          label: '不限',
          value: ''
        },
        {
          label: '待审核',
          value: '0'
        },
        {
          label: '审核通过',
          value: '1'
        },
        {
          label: '审核驳回',
          value: '2'
        }
      ]
    }
  },
  {
    key: 'supervisoryCode',
    label: '主管部门',
    tag: 'MTreeSelect',
    attrs: {
      data: [],
      fields: {
        value: 'deptId',
        label: 'deptName',
        children: 'children'
      }
    }
  }
])
export const modelValue = {
  activityName: '',
  orgName: '',
  supervisoryCode: ''
}
